#include <59header.h>

/* Usage: ./08_my_ls dirname  */
int main(int argc, char *argv[]){
    ARGS_CHECK(argc, 2);

    DIR *dirp = opendir(argv[1]);
    ERROR_CHECK(dirp, NULL, "opendir");

    struct dirent* direntp;
    while((direntp = readdir(dirp)) != NULL){
        printf("inode num = %lu, reclen = %hu, "
               "file type = %u, file name = %s\n",
                direntp ->d_ino,
                direntp -> d_reclen,
                direntp -> d_type,
                direntp -> d_name
               );
    }

    closedir(dirp);
    return 0;
}   

